Fixed a recurring high-frequency bug in a CMC feature.#130
Open
SalenGit wants to merge 1 commit intoNirAharon:mainfrom
Open
Fixed a recurring high-frequency bug in a CMC feature.#130SalenGit wants to merge 1 commit intoNirAharon:mainfrom
SalenGit wants to merge 1 commit intoNirAharon:mainfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
#90 #78
These issues mentioned above all stem from the same bug. Although some time has passed, I encountered the same problem and found an effective solution. I hope this helps the next person who comes across this.
The root cause is that the video scene you input has excessive changes, causing the optical flow algorithm to fail to find any matching keypoints between adjacent frames. Strangely, several other optical flow algorithms have already implemented effective handling for this scenario—specifically, assuming no pose change for frames where pose estimation fails. Only the default method
applySparseOptFlowlacks this implementation. Therefore, the solution is straightforward: replace the following code:to:
This perfectly resolves the issue. It instructs the algorithm to use the predefined identity transformation H matrix for frames where matching fails due to significant mid-process changes. Simultaneously, it preserves this frame for continued matching downstream. This ensures the optical flow algorithm resumes normal operation immediately once scene changes subside, preventing persistent errors.
Ideally, you should now encounter only one or two printed warnings, with no further errors occurring.